<template>
  <!-- 面包屑 -->
  <div>
    <el-breadcrumb :separator-icon="ArrowRight">
      <el-breadcrumb-item>首页</el-breadcrumb-item>
      <el-breadcrumb-item>我的</el-breadcrumb-item>
      <el-breadcrumb-item>个人信息</el-breadcrumb-item>
      <el-breadcrumb-item><b>我的门卡</b></el-breadcrumb-item>
    </el-breadcrumb>
  </div>
  <div style="margin:20px">
    <el-table :data="blogInfo">
      <el-table-column prop="access_card_number" align="center" label="门禁卡号" />
      <el-table-column prop="access_status"  align="center" label="门禁是否连接"  />
      <el-table-column prop="attendanc_card_number" align="center" label="出勤机卡号" />
      <el-table-column prop="attendanc_status" align="center" label="出勤机是否连接" />
      <el-table-column prop="specia_channel_card_number" align="center" label="特殊通道卡号" />
      <el-table-column prop="employee_access_status" align="center" label="员工通道是否连接" />
      <el-table-column prop="onetimecard"  align="center" label="首次绑卡时间" />
    </el-table>
  </div>
  <!--  分页-->
<!--  <div class="page">
    <el-pagination
        v-model:current-page="currentPage"
        v-model:page-size="pageSize"
        :page-sizes="[3,5]"
        :small="small"
        :disabled="disabled"
        :background="background"
        layout="sizes, prev, pager, next"
        :total="totals"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
    />
  </div>-->
</template>

<script setup>
import {ArrowRight,Edit} from "@element-plus/icons-vue";
import {onMounted, reactive, ref} from "vue";
import request from "@/utils/people";
const  mallInfo=ref([])
onMounted(()=>{
  getCards();
})

//分页
const currentPage = ref(1)
const pageSize = ref(3)
const small = ref(false)
const background = ref(false)
const disabled = ref(false)
let totals=ref(0);

const  blogInfo=ref([])
// 表格显示内容
const getCards = () => {
  const params = {
    pageNum: currentPage.value,
    pageSize: pageSize.value,
    // 初始时不包含ID参数
  };
  request({
    url: '/cards/canAll',
    method: 'get',
    params,
  }).then((req) => {
    console.log(req)
    if (200 == req.data.errorCode) {
      blogInfo.value = req.data.data.records.map(item => ({
        ...item,
      }));
      totals.value = req.data.data.total;
    }
  })
}
const searchOnSubmit=()=>{
  getCards()
}
</script>

<style scoped>
.page{
  margin-left: 40%;
}
.el-breadcrumb{
  font-size: 18px;
  margin: 20px;
}
.break{
  margin: 5px 0 0 10px;
}
</style>